<template>
	<!-- 问题解答 -->
	<view class="container" v-if="isloding">
		<view class="content">
			<view class="title">
				{{info.question}}
			</view>
			<view class="text">
				{{info.answer}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:'',
				isloding:false
			};
		},
		onLoad(e) {
			this.token=e.token
			uni.showLoading({
				title: '加载中',
				mask: false
			});
			uni.request({
				url: this.webUrl+'/user/my/answer/'+e.id,
				method: 'GET',
				header:{
					token:e.token
				},
				data: {},
				success: res => {
					console.log(res)
					uni.hideLoading()
					if(res.data.code==0){
						this.info=res.data.data
					}else if(res.data.code==3){
						uni.showToast({
							title: res.data.msg,
							icon:'none',
							duration:2000
						});
					}else{
						uni.showToast({
							title: '网络错误',
							icon:'none',
							duration:2000
						});
					}
					this.isloding=true
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style lang="scss" scoped>
	uni-page-body{
		height: 100%;
	}
	page{
		height: 100%;
	}
	.container{
		position: absolute;
		left: 0;
		bottom: 0;
		top: 0;
		right: 0;
		overflow: hidden;
		background: #f2f2f2;
		.content{
			margin-top: 30upx;
			background: #FFFFFF;
			.title{
				width: 90%;
				height: 60upx;
				background: #fd764b;
				border-bottom-right-radius: 30upx;
				border-top-right-radius: 30upx;
				color: #FFFFFF;
				line-height: 60upx;
				font-size: 28upx;
				padding-left: 30upx;
			}
			.text{
				height: 300upx;
				font-size: 28upx;
				padding: 30upx;
			}
		}
	}
</style>
